package com.peter.design.pattern.delegate.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: 肖冬
 * @Date: 2020/7/28 22:20
 * @Description:
 */
public class Leader implements IEmployee {
    private Map<String,IEmployee> targets = new HashMap<String,IEmployee>();

    public Leader() {
        targets.put("加密",new EmployeeA());
        targets.put("登录",new EmployeeB());
    }
    @Override
    public void doing(String command) {
        targets.get(command).doing(command);
    }
}
